<include file="public@header"/>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInUp js-check-wrap">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>编辑友情链接</h5>
                    <div class="ibox-tools">
                        <a href="{:url('link/index')}" class="btn btn-primary btn-xs">所有链接</a>
                        <a href="{:url('link/add')}" class="btn btn-primary btn-xs">添加链接</a>
                        <a href="#" class="btn btn-primary btn-xs active">编辑友情链接</a>
                    </div>
                </div>
                <div class="ibox-content">
                    <form class="form-horizontal js-ajax-form" action="{:url('link/editPost')}" method="post">
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span class="form-required">*</span>名称</label>

                                <div class="col-sm-6">
                                    <input type="text" class="form-control" id="input-name" name="name" value="{$link.name}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span class="form-required">*</span>链接地址</label>

                                <div class="col-sm-6">
                                    <input type="text" class="form-control" id="input-url" name="url" value="{$link.url}">
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">图标</label>

                                <div class="col-sm-6">
                                    <input type="text" class="form-control" id="input-link_image" name="image" value="{$link.image}">
                <a href="javascript:uploadOneImage('图片上传','#input-link_image');">上传图片</a>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">打开方式</label>
                                <div class="col-sm-6">
                                    <select class="form-control" name="target" id="input-target">
                                        <foreach name="targets" item="vo">
                                            <php>$link_target_selected=$link['target']==$key?"selected='selected'":"";</php>
                                            <option value="{$key}" {$link_target_selected}>{$vo}</option>
                                        </foreach>
                                    </select>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label">描述</label>
                                <div class="col-sm-6">
                                    <textarea class="form-control" name="description" id="input-description" >{$link.description}</textarea>
                                </div>
                            </div>
                            <div class="hr-line-dashed"></div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-6">
                                    <input type="hidden" name="id" value="{$link.id}">
                                    <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
                                    <a class="btn btn-default" href="{:url('link/index')}">{:lang('BACK')}</a>
                                </div>
                            </div>
                    </form>                
            </div>
        </div>
    </div>
</div>
<script src="__STATIC__/js/admin.js"></script>

</body>
</html>